package com.easyadmin.entity.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @Description: 账号状态
 * @auther: 多多洛
 * @date: 14:28 2020/11/21
 * @param:
 * @return:
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AccountStatusEnum {
    DISABLE(0, "禁用"), ENABLE(1, "启用");

    private Integer status;
    private String description;

    AccountStatusEnum(int status, String description) {
        this.status = status;
        this.description = description;
    }

    public Integer getStatus() {
        return status;
    }

    public String getDescription() {
        return description;
    }

    public static AccountStatusEnum getByStatus(Integer status) {
        for (AccountStatusEnum at : AccountStatusEnum.values()) {
            if (at.status.equals(status)) {
                return at;
            }
        }
        return null;
    }
}
